package com.example.wzz;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("upload")
@CrossOrigin
public class UploadFileUtils {
    @Autowired
    private UploadFileUtil uploadFileUtil;
    @RequestMapping("/file")
    public VueResult uploadFile(MultipartFile file,String product,String itemName ){
        return uploadFileUtil.uploadFile(file,product,itemName);
    }
    @RequestMapping("/deleteFile")
    public VueResult deleteFile(String url ){
        return uploadFileUtil.deleteFile(url);
    }
}
